package study_1;

/**
 * 线程类中已废弃的方法
 *      1.stop() 停止线程的执行
 *      2.suspend() 暂停线程的运行
 *      3.resume() 使被暂停的线程继续运行
 */
public class Thread6 {
    public static void main(String[] args) {
        TestThread testThread = new TestThread();
        Thread thread = new Thread(testThread);
        thread.start();
//        thread.stop();
        thread.suspend();
//        thread.resume();
    }

    static class TestThread implements Runnable{
        @Override
        public void run() {
            for (int i = 0; i < 100; i++) {
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println(Thread.currentThread());
            }
        }
    }
}
